﻿@model mytechblog.Article

@{
	ViewBag.Title = "Edit";
}
<script src="@Url.Content("~/ckeditor/ckeditor.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/edit.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>

<h2>Edit</h2>
@Html.ActionLink("Create New", "Edit", new { }, new { Class = "btn btn-primary editList_link" })
<br />
@using (Html.BeginForm())
{ 
	<fieldset>
	@Html.ValidationSummary(true)

	<div class="js_edit_id">
		@Html.HiddenFor(model => model.ID)
	</div>
	<table class="edit_table">
		<tr>
			<td>
				<div class="editor-label">
					@Html.LabelFor(model => model.Title)
				</div>
			</td>
			<td>
				<div class="editor-field">
				  @Html.EditorFor(model => model.Title)
				  @Html.ValidationMessageFor(model => model.Title)
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="editor-label">
				  @Html.LabelFor(model => model.UrlPart)
				</div>
			</td>
			<td>
				<div class="editor-field">
				  @Html.EditorFor(model => model.UrlPart)
				  @Html.ValidationMessageFor(model => model.UrlPart)
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="editor-label">
					@Html.LabelFor(model => model.IsVisible)
				</div>
			</td>
			<td>
				<div class="editor-field">
				  @Html.EditorFor(model => model.IsVisible)
				  @Html.ValidationMessageFor(model => model.IsVisible)
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="editor-label">
				  @Html.LabelFor(model => model.ArticleContent)
				</div>
			</td>
			<td>
				<div class="editor-field js_editor">
					@Html.EditorFor(model => model.ArticleContent)
					@Html.ValidationMessageFor(model => model.ArticleContent)
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<div class="editor-label">
				  @Html.LabelFor(model => model.ArticleContentPreview)
				</div>
			</td>
			<td>
				<div class="editor-field js_editor">
				  @Html.EditorFor(model => model.ArticleContentPreview)
				  @Html.ValidationMessageFor(model => model.ArticleContentPreview)
				</div>
			</td>
		</tr>
	</table>
		
	<div>
	  <input type="submit" class="btn" value="Save" />
	</div>
  </fieldset>
}
